Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Utility Function

The standard dialog component provides a single utility function that you can use to create a graphics world that is appropriate for the current compression settings. This function is described next.

SCNewGWorld

The SCNewGWorld function creates a graphics world based on the current compression settings.

pascal ComponentResult SCNewGWorld (ComponentInstance ci,
                                          GWorldPtr *gwp, Rect *rp,
                                          GWorldFlags flags);
ci
Identifies your application's connection to a standard image-compression dialog component.
gwp
Contains a pointer to a pointer to a graphics world. The standard dialog component places a pointer to the new graphics world into the field referred to by this parameter. If the component cannot create the graphics world, it sets this field to nil .
Your application is responsible for disposing of the graphics world when you are done with it.
rp
Contains a pointer to the boundaries of the graphics world. If you set this parameter to nil , the standard dialog component uses the test image's boundary rectangle. If you don't specify a boundary rectangle and there is no test image, the component does not create the graphics world.
flags
Contains flags that are passed to QuickDraw's NewGWorld function. See the chapter "Basic QuickDraw" in Inside Macintosh: Imaging for more information about this function.

DESCRIPTION

The SCNewGWorld function creates a graphics world that can accommodate the current compression settings, including color table and grayscale settings (if appropriate). If the selected color table is inappropriate for the pixel depth, the standard dialog component uses a standard color for the depth.

RESULT CODE

scTypeNotFoundErr

-8971

Component cannot create a graphics world


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next